import request from '../utils/request';

export const getUsersLoginApi = (data) => request.post('/users/login', data);

export const getUsersApi = (params) => request.get('/users', {
  params,
});

export const addUsersApi = (data) => request.post('/users', data);

export const checkUsersExistApi = (field, value) => request.get('/users/exist', {
  params: {
    field,
    value,
  },
});

export const getUserByIdApi = (id) => request.get(`/users/${id}`);

export const updateUserByIdApi = (id, data) => request.put(`/users/${id}`, data);

export const deleteUserByIdApi = (id) => request.delete(`/users/${id}`);

export const deleteUsersByIdsApi = (ids) => request.delete('/users', {
  data: { ids },
});
export default {};
